package com.project.controller;

import com.project.bean.FacilityBean;
import com.project.bean.RoomBean;
import com.project.service.FacilityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("facil")
public class FacilityController {

    @Autowired
    private FacilityService service;


    @RequestMapping("findById")
    public List<FacilityBean> findById(Integer id){
        return service.findById(id);
    }

    @RequestMapping ("add")
    public void add(String describe,Integer roomId){
        FacilityBean facilityBean = new FacilityBean(describe,roomId);
        service.add(facilityBean);
    }

    @RequestMapping("update")
    void update(Integer facilityID,Integer roomId){
        service.updateOver(facilityID,roomId);
    }
}
